package com.zb.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zb.entity.ZjFault;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author WEN
 * @since 2023-07-31
 */
@Repository
public interface ZjFaultMapper extends BaseMapper<ZjFault> {

    /**
     * 批量启用或禁用故障
     * @param idList 故障ID集合
     * @param disable 状态：false-启用，true-禁用
     * @return
     */
    int updateBatchDisableByIds(@Param("idList") List<Long> idList, @Param("disable") boolean disable);


    /**
     * 根据故障查询是否重复
     * @param custAccId 商家ID
     * @param id 故障ID
     * @param name 故障名称
     * @return
     */
    Integer existByName(@Param("custAccId") Long custAccId, @Param("id") Long id, @Param("name") String name);

    /**
     * 根据ID集合查询故障名称
     * @param idList 集合
     * @return
     */
    List<String> getNameByIds(@Param("idList") List<Long> idList);
}
